<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app">
      <ul>
        <!-- v-for用于做循环渲染 -->
        <!-- 哪个元素需要循环，就加给哪个元素 -->
        <!-- item是一个形参,表示里面的每一项 -->
        <li v-for="item in list">{{ item }}</li>
      </ul>

      <div v-for="item in list2">{{ item.title }}</div>
    </div>

    <script src="../Vue.js"></script>
    <script>
      new Vue({
        el: "#app",
        data: {
          list: [1, 2, 3, 4, 5, 6, 7],
          list2: [
            {
              title: "标题1",
            },
            {
              title: "标题2",
            },
            {
              title: "标题3",
            },
          ],
        },
      });
    </script>
  </body>
</html>
